home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmGetHstSample
- BorderStyle = 3 'Fixed Dialog
- Caption = "GetHst Sample Project"
- ClientHeight = 5025
- ClientLeft = 1470
- ClientTop = 1980
- ClientWidth = 7710
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 5430
- Left = 1410
- LinkTopic = "Form1"
- LockControls = -1 'True
- ScaleHeight = 5025
- ScaleWidth = 7710
- Top = 1635
- Width = 7830
- Begin VB.CheckBox chkBlocking
- Caption = "Blocking (Synchronous)"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 7
- Top = 1560
- Width = 3135
- End
- Begin VB.CommandButton cmdExit
- Cancel = -1 'True
- Caption = "Exit"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 4320
- TabIndex = 6
- Top = 1320
- Width = 3135
- End
- Begin VB.CommandButton cmdGetName
- Caption = "Translate IP Address To Host Name"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 4320
- TabIndex = 5
- Top = 720
- Width = 3135
- End
- Begin VB.CommandButton cmdGetAddress
- Caption = "Translate Host Name To IP Address"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 4320
- TabIndex = 4
- Top = 240
- Width = 3135
- End
- Begin VB.TextBox txtIPAddress
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 240
- TabIndex = 3
- Top = 1080
- Width = 3735
- End
- Begin VB.TextBox txtHostName
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 240
- TabIndex = 1
- Top = 480
- Width = 3735
- End
- Begin VB.Label Label5
- Caption = $"gethsts.frx":0000
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 855
- Left = 240
- TabIndex = 10
- Top = 3960
- Width = 7215
- End
- Begin VB.Label Label4
- Caption = $"gethsts.frx":0180
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 855
- Left = 240
- TabIndex = 9
- Top = 3000
- Width = 7215
- End
- Begin GetHstLib.GetHst GetHst1
- Left = 0
- Top = 0
- _Version = 327680
- _ExtentX = 847
- _ExtentY = 847
- _StockProps = 64
- Host = ""
- HostAddress = ""
- Blocking = -1 'True
- End
- Begin VB.Label Label3
- Caption = $"gethsts.frx":02C9
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 240
- TabIndex = 8
- Top = 2280
- Width = 7215
- End
- Begin VB.Label Label2
- Caption = "IP Address:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 2
- Top = 840
- Width = 2775
- End
- Begin VB.Label Label1
- Caption = "Host Name:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 0
- Top = 240
- Width = 2775
- End
- Attribute VB_Name = "frmGetHstSample"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim LastAction As Integer
- Private Sub cmdExit_Click()
- End
- End Sub
- Private Sub cmdGetAddress_Click()
- ' Translate host name to IP address
- txtIPAddress = ""
- GetHst1.Blocking = chkBlocking
- GetHst1.Host = txtHostName
- GetHst1.Action = 1
- ' If blocking, show IP to user.
- If chkBlocking Then
- txtIPAddress = GetHst1.HostAddress
- LastAction = 0
- Else
- LastAction = 1
- ' Disable buttons so user doesn't
- ' fire extra queries. Display
- ' of results is handled in the Done
- ' event
- cmdGetName.Enabled = False
- cmdGetAddress.Enabled = False
- cmdExit.Enabled = False
- End If
- End Sub
- Private Sub cmdGetName_Click()
- ' Translate IP address to host name
- txtHostName = ""
- GetHst1.Blocking = chkBlocking
- GetHst1.HostAddress = txtIPAddress
- GetHst1.Action = 2
- ' If blocking, show IP to user.
- If chkBlocking Then
- txtHostName = GetHst1.Host
- LastAction = 0
- Else
- LastAction = 2
- ' Disable buttons so user doesn't
- ' fire extra queries. Display
- ' of results is handled in the Done
- ' event
- cmdGetName.Enabled = False
- cmdGetAddress.Enabled = False
- cmdExit.Enabled = False
- End If
- End Sub
- Private Sub GetHst1_Done(ErrorCode As Integer)
- ' Translation done, re-enable buttons.
- cmdGetName.Enabled = True
- cmdGetAddress.Enabled = True
- cmdExit.Enabled = True
- ' Display text based on action taken
- Select Case LastAction
- Case 1: ' get host address
- txtIPAddress = GetHst1.HostAddress
- Case 2: ' get host name
- txtHostName = GetHst1.Host
- End Select
- End Sub
-